//
//  JMUnzipFile.h
//  JMLogic
//
//  Created by Aventador on 15/8/4.
//  Copyright (c) 2015年 JD. All rights reserved.
//

#import <Foundation/Foundation.h>
#include "zip.h"
#include "unzip.h"

@protocol JMUnzipFileDelegate <NSObject>
@optional
-(void) ErrorMessage:(NSString*) msg;
-(BOOL) OverWriteOperation:(NSString*) file;

@end


@interface JMUnzipFile : NSObject
{
@private
    zipFile		_zipFile;
    unzFile		_unzFile;
    
    NSString*   _password;
    id			_delegate;
}

@property (nonatomic, retain) id<JMUnzipFileDelegate> delegate;
-(BOOL) CreateZipFile2:(NSString*) zipFile;
-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password;
-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
-(BOOL) CloseZipFile2;
-(BOOL) UnzipOpenFile:(NSString*) zipFile;
-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password;
-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite;
-(BOOL) UnzipCloseFile;
@end
